# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Francois Boulogne <fboulogne at april dot org>

pkgname=fabric
pkgver=3.0.0
pkgrel=2
pkgdesc="Python library and command-line tool designed to streamline deploying applications or performing system administration tasks via the SSH protocol"
url="https://www.fabfile.org/"
license=('BSD')
arch=('any')
depends=('python-paramiko' 'python-invoke' 'python-decorator')
optdepends=('python-patchwork: Common deployment/sysadmin operations')
makedepends=(python-setuptools python-wheel python-build python-installer)
source=("https://github.com/fabric/fabric/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('4398a075286fad201001edf170f88d671992303efa8890fbe63b29c3677f7ba4bc39b3630b65e3cd63529a0c28b0e0d324e699fa3abe782ab3f6b42cf7335871')

build() {
  cd "${srcdir}"/fabric-${pkgver}
  python -m build --wheel --no-isolation
}

package() {
  cd "${srcdir}"/fabric-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 README.rst "${pkgdir}"/usr/share/doc/${pkgname}/README.rst
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
